<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>正则表达式的exec</title>
		<script>
			var str="老刘的手机号13865997763，胡汪洋的手机号13666666666，杨旭的手机号13105518888，赵俊杰的手机号1388888888";
			var reg=/1\d{10}/g;
			// let ar=str.split(reg);
			// alert(ar.join("$$$$"));
			// let a2=str.search(reg);
			// document.write(a2+"<br/>");
			
			//把每个人手机号提出来
			let phone="";
			while (phone!==null){
				phone = reg.exec(str);
				if(phone==null)
					break;
				document.write(phone+"<br/>");
				
			}
		</script>
	</head>
	<body>
	</body>
</html>